import React from "react";
import lazyLoad from "@/routers/utils/lazyLoad";
import { LayoutIndex } from "@/routers/constant";
import { RouteObject } from "@/routers/interface";

// dashboard 模块
const dashboardRouter: Array<RouteObject> = [
	{
		element: <LayoutIndex />,
		path: "/recovery",
		permissions: [
			"recoveryView",
			"recoveryAfterSaleView",
			"stagingListView",
			"recoveryChannelView",
		],
		meta: {
			title: "回收管理",
			icon: "CloudSyncOutlined",
			sort: 2,
		},
		children: [
			{
				path: "/recovery/recovery-list",
				element: lazyLoad(React.lazy(() => import("@/views/recovery/recoveryList/index"))),
				meta: {
					requiresAuth: true,
					icon: "CloudSyncOutlined",
					title: "回收列表",
					key: "recoveryView",
					keepAlive: true,
				}
			},
			{
				path: "/recovery/embedded1",
				element: lazyLoad(React.lazy(() => import("@/views/recovery/recoveryList/index"))),
				meta: {
					requiresAuth: true,
					icon: "CloudSyncOutlined",
					title: "售后列表",
					key: "recoveryAfterSaleView"
				}
			},
			{
				path: "/recovery/embedded2",
				element: lazyLoad(React.lazy(() => import("@/views/recovery/recoveryList/index"))),
				meta: {
					requiresAuth: true,
					icon: "CloudSyncOutlined",
					title: "回收渠道",
					key: "recoveryChannelView"
				}
			}
		]
	}
];

export default dashboardRouter;
